<?php TPL::output('global/header_meta.tpl.htm'); ?>

<body class="bd">
<div class="wrapper">
	<div class="hd">
    	<div class="i_bd i_prl">
        	<h1 class="logo i_left"><a href="<?php echo get_setting('base_url'); ?>"><img title="<?php echo get_setting('site_name'); ?>" class="img" src="<?php echo G_STATIC_URL; ?>/css/<?php echo $this->template_name; ?>/img/logo_103x25.png" alt="<?php echo get_setting('site_name'); ?>" /></a></h1>

			<?php if ($this->user_id || $this->user_info['permission']['search_avail']) { ?>
            <div class="i_search i_prl i_left">
                <form action="search/" id="global_search_form" method="post" >
					<input class="i_txt" autocomplete="off" name="q" value="搜索站点、标签或人" onSubmit="return false;" id="i_search" data-category_enable="<?php echo (get_setting('category_enable') == 'Y') ? 1 : 0; ?>" title="搜索站点、标签或人..."/>
					<a href="javascript:;" id="global_search_btns" onClick="$('#global_search_form').submit();" class="i_result i_pas" title="点击搜索 »">搜索</a>
				</form>
             </div>
			<?php } ?>

			<p class="b_menu i_left">

			<?php if ($this->user_id) { ?>
             	<a href="<?php echo get_setting('base_url'); ?><?php if (get_setting('url_rewrite_enable') != 'Y') { ?>/<?php echo rtrim(G_INDEX_SCRIPT, '/'); ?><?php } ?>" class="i_index<?php if (!$_GET['app'] OR ($_GET['app'] == 'home' AND $_GET['act'] != 'explore')) { ?> cur<?php } ?>"><em class="i i_small"></em>首页</a>
			<?php } ?>

                <a  href="home/explore/" class="i_index<?php if ($_GET['app'] == 'question' OR $_GET['act'] == 'explore') { ?> cur<?php } ?>"><em class="q i_small"></em>站点</a>
                <a href="topic/" class="i_index<?php if ($_GET['app'] == 'topic') { ?> cur<?php } ?>"><em class="t i_small"></em>标签</a>
                <!--<a href="people/list/" class="i_index<?php if ($_GET['app'] == 'people') { ?> cur<?php } ?>"><em class="u i_small"></em>用户</a>-->
               <a href="notifications/" id="not_message" class="not_message">通知 <?php if ($this->user_id) { ?><em class="i_message_tooltip_s" style="display:none;" id="notifications_num" data-value="<?php echo $this->user_info['notification_unread']; ?>"><?php echo $this->user_info['notification_unread']; ?></em><?php } ?></a>
               
             </p>

				<?php if ($this->user_id) { ?>
					<div class="i_pas b_startQs">
		             	<a href="publish/<?php if ($_GET['category']) { ?>category_id-<?php echo intval($_GET['category']); ?>__<?php } ?><?php if ($this->topic_info) { ?>topic_title-<?php echo urlencode($this->topic_info['topic_title']); ?>__<?php } ?>" class="b_startq i_radiu5 <?php if ($_GET['app'] == 'publish') { ?> cur<?php } ?>"<?php if (get_setting('quick_publish') == 'Y' && $this->user_id) { ?> onClick="$.startQs({flgs:0, category_enable:<?php echo (get_setting('category_enable') == 'Y') ? 1 : 0; ?>, category_id:'<?php echo intval($_GET['category']); ?>', topic_title:'<?php echo $this->topic_info['topic_title']; ?>'}); return false;"<?php } ?> title="发起你的站点，寻找最佳答案 »">发起</a>
		                <div class="b_user i_pas ">
							<a href="people/<?php echo $this->user_info['url_token']; ?>" class="user_head i_gltxtHide"><?php echo $this->user_info['user_name']; ?><img src="<?php echo get_avatar_url($this->user_info['uid'], 'mid'); ?>" class="b_userpic i_radiu3" title="<?php echo $this->user_info['user_name']; ?>" alt="<?php echo $this->user_info['user_name']; ?>"/><em class="i_message_tooltip_s i_pas inbox_num" style="display:none;"><?php echo $this->inbox_unread; ?></em></a>
								
							<p class="b_drop_down i_prl i_bottomRadius5"><a href="inbox/" class="private_letter">私信<em class="i_message_tooltip_s inbox_num" style="display:none;">0</em></a><a href="account/setting/profile/" title="设置" class="set">设置</a><?php if($this->user_info['permission']['is_administortar'] ) { ?><a href="<?php echo get_setting('base_url') . G_INDEX_SCRIPT; ?>admin/" title="管理" class="manage" target="_blank">管理</a><?php } ?><a href="account/logout/" class="exit">退出</a>
							</p>
						</div>
					</div>
				<?php }else{ ?>
					<div class="i_pas b_startQs" style="text-align:right;line-height:45px;"><a href="account/login/">登录</a>&nbsp;&nbsp;&nbsp;&nbsp;<a href="account/register/">注册</a></div>

				<?php } ?>
        </div>
    </div>
 
    
    
